import request from '@/utils/request'

// 查询代理管理列表
export function listProxy(query) {
  return request({
    url: '/business/proxy/list',
    method: 'get',
    params: query
  })
}
// 查询代理管理列表
export function treeListProxy(query) {
  return request({
    url: '/business/proxy/treelist',
    method: 'get',
    params: query
  })
}
// 查询代理管理下级列表
export function listSubProxy(query) {
  return request({
    url: '/business/proxy/subList',
    method: 'get',
    params: query
  })
}

// 查询代理管理详细
export function getProxy(id) {
  return request({
    url: '/business/proxy/' + id,
    method: 'get'
  })
}

// 新增代理管理
export function addProxy(data) {
  return request({
    url: '/business/proxy',
    method: 'post',
    data: data
  })
}
// 新增代理管理
export function addSubProxy(data) {
  return request({
    url: '/business/proxy/addSubProxy',
    method: 'post',
    data: data
  })
}

// 修改代理管理
export function updateProxy(data) {
  return request({
    url: '/business/proxy',
    method: 'put',
    data: data
  })
}

// 删除代理管理
export function delProxy(id) {
  return request({
    url: '/business/proxy/' + id,
    method: 'delete'
  })
}

// 导出代理管理
export function exportProxy(query) {
  return request({
    url: '/business/proxy/export',
    method: 'get',
    params: query
  })
}